package com.demo;

import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.util.Base64;
import org.junit.Test;

/**
 * @author hongxiao.z
 * @date   2014-1-9  上午11:20:24
 */
public class Main
{
	public static void main(String[] args) 
	{
		IoBuffer buf = IoBuffer.allocate(255);
		buf.putInt(1233321132);
		buf.flip();
		Base64 base = new Base64();
		byte[] d = base.decode(buf.array());
		for (byte b : d) {
			System.out.print(b + " ");
		}
//		base641.encode(buf.array());
		
		System.out.println(buf.getUnsignedInt());
		
//		short s = 123;
//		String str = "asdf";
//		String sstr = s + str;
//		IoBuffer buf = IoBuffer.allocate(255);
//		buf.putShort(s);
//		buf.put(str.getBytes());
//		buf.flip();
//		Base64 base641 = new Base64();
//		base641.encode(buf.array());
//		Base64 base64 = new Base64();
//		buf = IoBuffer.allocate(255);
//		buf.put(base64.decode(sstr.getBytes()));
//		buf.flip();
//		System.out.println(buf.getUnsignedShort());
//		System.out.println(buf.getChar());
	}
	
	public static int check8(String card)
	{
		return 1;
	}
	
	public static int check16(String card)
	{
		return 1;
	}
	
	@Test
	public void test()
	{
		System.out.println(Integer.toBinaryString(0x7F));
		System.out.println(0x007F);
	}
}
